Skip to content

[JEWEL-1277] Add FrontMatter metadata block support for Markdown#3454

Open
AlexVanGogen wants to merge 1 commit intoJetBrains:masterfrom
AlexVanGogen:alexvangogen/JEWEL-1277-front-matter-support
Open

[JEWEL-1277] Add FrontMatter metadata block support for Markdown#3454
AlexVanGogen wants to merge 1 commit intoJetBrains:masterfrom
AlexVanGogen:alexvangogen/JEWEL-1277-front-matter-support

Conversation

@AlexVanGogen
Copy link
Copy Markdown
Contributor

@AlexVanGogen AlexVanGogen commented Mar 9, 2026

Summary

Add support for YAML front matter metadata blocks in Jewel's Markdown rendering. Front matter content (delimited by --- markers at the beginning of a file) is parsed and rendered as a table where keys form the first column and values form the second column. It differs from other renderers that prefer using rows (likely because then the keys will render in bold), but it helps keeping all the information in a Markdown file readable without coming down to horizontal scrolling.

Multi-value (list) entries are rendered as Markdown lists (opposite to one-row tables in other renderers), again, to keep the vertical structure of the block.

Fixes JEWEL-1277

Changes

  • New front-matter extension module (intellij.platform.jewel.markdown.extensions.frontMatter) with a FrontMatterProcessorExtension that integrates with Jewel's Markdown processor pipeline
  • Custom block parser (FrontMatterBlockParser) supporting plain key-value pairs, YAML lists, quoted strings, and block scalars (literal | and folded > with all chomping indicators)
  • Refactored gfm-tables Table model classes (TableBlock, TableCell, TableHeader, TableRow) from internal to public experimental API to allow reuse by front matter rendering
  • Changed TableBlock.header to nullable (TableHeader?) to support headerless tables (used for nested value tables)
  • Changed TableCell.content from List<InlineMarkdown> to MarkdownBlock to support block-level content in cells (e.g., nested tables)
  • Updated GitHubTableBlockRenderer to render block content in cells via RenderBlock instead of RenderParagraph
  • Added 22 unit tests covering various front matter scenarios including block scalars, lists, quoted values, and edge cases

Demo

Tested scenarios

Use case Screenshot
Simple key-value block Screenshot 2026-04-01 at 19 21 11
Single key block Screenshot 2026-04-01 at 19 21 47
Empty block Screenshot 2026-04-01 at 19 23 28
List Screenshot 2026-04-01 at 19 24 08
Single item Screenshot 2026-04-01 at 19 24 39
Mixed scalar and list values Screenshot 2026-04-01 at 19 25 11
Block parsing stops on non-front-matter syntax Screenshot 2026-04-01 at 19 25 49
Block not at document start Screenshot 2026-04-01 at 19 26 44
List items with colon Screenshot 2026-04-01 at 19 27 12
Scalar with newlines Screenshot 2026-04-01 at 19 32 30
Scalar with leading lines Screenshot 2026-04-01 at 19 28 27
Strip chomping Screenshot 2026-04-01 at 19 28 59
Keep chomping Screenshot 2026-04-01 at 19 31 21
Folding Screenshot 2026-04-01 at 19 33 50
Folding + strip chomping Screenshot 2026-04-01 at 19 34 23
Folding + keep chomping Screenshot 2026-04-01 at 19 35 03
Folding + blank lines Screenshot 2026-04-01 at 19 35 38
Empty scalar Screenshot 2026-04-01 at 19 36 15
Empty scalar + key Screenshot 2026-04-01 at 19 37 14
Non-empty scalar + key Screenshot 2026-04-01 at 19 37 42
Unquote quotes Screenshot 2026-04-01 at 19 38 05

Typing in

Screen.Recording.2026-03-09.at.18.58.35.mov

Release notes

New features

@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1277-front-matter-support branch from 5cff30b to 48efc38 Compare March 9, 2026 19:23
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1277-front-matter-support branch 2 times, most recently from 8aea4d1 to bc78700 Compare March 10, 2026 19:20
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1277-front-matter-support branch 4 times, most recently from d2ef681 to 169af6d Compare April 1, 2026 22:33
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1277-front-matter-support branch from 169af6d to 65f19df Compare April 1, 2026 22:53
@AlexVanGogen AlexVanGogen marked this pull request as ready for review April 1, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants